<?php 
if (!empty($this->flash_messages))
{
    foreach ($this->flash_messages as $flash_message)
    {
        echo '<div class="message">'.$flash_message.'</div>';
    }
}
?>
<h1 class="caption"><?php echo Zend_Registry::get('locale')->_('Users') ?></h1>


<?php if (!empty($this->users)) : ?>
    <?php foreach ($this->users as $user) : ?>
      <div class="user-profile-item">
        <h2><a href="<?php echo $this->fixUrl('user/view/'.$user->id) ?>"><?php echo htmlspecialchars($user) ?></a></h2>
        <?php $avatar=$user->getAvatar() ?>
        <?php if (!empty($avatar)) : ?>
              <?php echo $this->image('users',$avatar,'',100,100,true); ?>
        <?php endif; ?>
        <div><?php echo '<strong>'.Zend_Registry::get('locale')->_('Role').': </strong>'.$user->getRole(); ?></div>
        <div><?php echo '<strong>'.Zend_Registry::get('locale')->_('Status').': </strong>'.$user->getStatus(); ?></div>
        <p><?php echo nl2br(strip_tags($user->getDescription())) ?></p>
        <?php if (Zend_Registry::get('user')->canManage()) : ?>
        <div class="user-links">
            <a href="<?php echo $this->fixUrl('user/edit/'.$user->id) ?>"><?php echo Zend_Registry::get('locale')->_('Edit') ?></a>
            &nbsp;|&nbsp;
            <a class="delete" href="javascript:if(confirm('<?php echo Zend_Registry::get('locale')->_('Are you sure ?')?>')){window.location.href='<?php echo $this->fixUrl('user/delete/'.$user->id) ?>'}"><?php echo Zend_Registry::get('locale')->_('Delete') ?></a>
        </div>
        <?php endif; ?>
        <div class="clear"></div>
      </div>
    <?php endforeach; ?>
<?php endif; ?>

<?php echo $this->paginator ?>